#include "FileMenu.h"
#include "NewAction.h"
#include "OpenAction.h"
#include "ExitAction.h"

FileMenu::FileMenu(QWidget *myParent)
    : QMenu("File", myParent)
    , m_newAction(NULL)
    , m_openAction(NULL)
    , m_exitAction(NULL)
{
    init();
}

FileMenu::~FileMenu()
{

}

void FileMenu::init()
{
    m_newAction = new NewAction();
    m_openAction = new OpenAction();
    m_exitAction = new ExitAction();

    this->addAction(m_newAction->objectName(), m_newAction, SLOT(onNewAction()));
    this->addAction(m_openAction->objectName(), m_openAction, SLOT(onOpenAction()));
    this->addSeparator();
    this->addAction(m_exitAction->objectName(), m_exitAction, SLOT(onExitAction()));
}
